import request from '@/utils/request'

export function topicList(query) {
  return request({
    url: '/risk/topic/list',
    method: 'get',
    params: query
  })
}


export function topicDelete(id) {
  return request({
    url: '/risk/topic/delete',
    method: 'get',
    params: {id}
  })
}

export function topicCreate(data) {
  return request({
    url: '/risk/topic/create',
    method: 'post',
    data
  })
}

export function topicUpdate(data) {
  return request({
    url: '/risk/topic/update',
    method: 'post',
    data
  })
}


export function answerList(query) {
    return request({
      url: '/risk/topic/options/list',
      method: 'get',
      params: query
    })
  }
  
  
  export function answerDelete(id) {
    return request({
      url: '/risk/topic/options/delete',
      method: 'get',
      params: {id}
    })
  }
  
  export function answerCreate(data) {
    return request({
      url: '/risk/topic/options/create',
      method: 'post',
      data
    })
  }
  
  export function answerUpdate(data) {
    return request({
      url: '/risk/topic/options/update',
      method: 'post',
      data
    })
  }
  
  // 指标相关接口

  export function indexList(query) {
    return request({
      url: '/risk/check/index/result/list',
      method: 'get',
      params: query
    })
  }
  
  
  export function indexDelete(id) {
    return request({
      url: '/risk/check/index/result/delete',
      method: 'get',
      params: {id}
    })
  }
  
  export function indexCreate(data) {
    return request({
      url: '/risk/check/index/result/create',
      method: 'post',
      data
    })
  }
  
  export function indexUpdate(data) {
    return request({
      url: '/risk/check/index/result/update',
      method: 'post',
      data
    })
  }

    // 评估疾病接口

    export function illnessList(query) {
      return request({
        url: '/risk/illness/list',
        method: 'get',
        params: query
      })
    }
    
    
    export function illnessDelete(id) {
      return request({
        url: '/risk/illness/delete',
        method: 'get',
        params: {id}
      })
    }
    
    export function illnessCreate(data) {
      return request({
        url: '/risk/illness/create',
        method: 'post',
        data
      })
    }
    
    export function illnessUpdate(data) {
      return request({
        url: '/risk/illness/update',
        method: 'post',
        data
      })
    }
// 指标维护
    export function illnessIndexAssigned(id) {
      return request({
        url: '/risk/illness/index/get',
        method: 'get',
        params: {illnessId:id}
      })
    }

    export function illnessAssignedUpdate(data) {
      return request({
        url: '/risk/illness/index/assigned',
        method: 'post',
        data
      })
    }

    // 问题维护
    export function illnessTopic(id) {
      return request({
        url: '/risk/illness/topic/get',
        method: 'get',
        params: {illnessId:id}
      })
    }

    export function illnessTopicUpdate(data) {
      return request({
        url: '/risk/illness/topic/assigned',
        method: 'post',
        data
      })
    }